package com.example.myapplication2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class action extends AppCompatActivity {

    private TextView mTextView;

    private Button  walking;
    private Button  jogging;
    private Button  stairs;
    private Button  sitting;
    private Button  standing;
    private Button  typing;
    private Button  writing;
    private Button  Clapping;

    public void setAction(int j){
        for(int i=0;i<8;i++) {
            if(i==j)para.action[i]=1;
            else para.action[i]=0;
        }
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_action);
        Log.d("","jinlaile");
        walking=(Button) findViewById(R.id.btn_walking);
        walking.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(0);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        jogging=(Button) findViewById(R.id.jogging);
        jogging.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(1);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        stairs=(Button) findViewById(R.id.stairs);
        stairs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(2);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        sitting=(Button) findViewById(R.id.sitting);
        sitting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(3);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        standing=(Button) findViewById(R.id.standing);
        standing.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(4);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        typing=(Button) findViewById(R.id.typing);
        typing.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(5);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        writing=(Button) findViewById(R.id.writing);
        writing.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(6);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });

        Clapping=(Button) findViewById(R.id.Clapping);
        Clapping.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setAction(7);
                Intent intent=new Intent(action.this, setTime.class);
                startActivity(intent);
            }
        });


    }
}